Api.RequestSlaveState method
Requests an EtherCAT slave to go into the specified EtherCAT state. For example, if the state is Op, and your requested state is PreOp, the slave will change the state to Op -> SafeOp -> PreOp. If the state is Init and your requested state is Op, the slave will change the state to Init -> PreOp -> SafeOp -> Op.
Namespace: IntervalZero.KINGSTAR.Local.Api
Assembly: IntervalZero.KINGSTAR.Local.Api (in IntervalZero.KINGSTAR.Local.dll) Version: 4.4.0.0
Syntax
public KsCommandStatus RequestSlaveState(
int SlaveId,
EthercatState State
)
Public Function RequestSlaveState(
SlaveId As Integer,
State As EthercatState
) As KsCommandStatus
Parameters
SlaveId
Type: int
The slave index. This index value is automatically assigned by the KINGSTAR master when the EtherCAT network starts, based on the physical connection order. The first device connected directly to the master is assigned Index 0, followed by Index 1, Index 2, and so on. These indexes remain consistent within the slave array even if devices are added, removed, or reconnected. Please refer to the use cases in HotConnect, Repair, and Restart for more details.
State
Type: EthercatState
The requested EtherCAT state.
Return value
Type: KsCommandStatus
Returns the KsCommandStatus class.
Remarks
- Both EtherCAT master and slave need to be in one of the supported states.
- It is not possible to request the EtherCAT state that is higher than the master state. For further details about which states the master supports, see RequestState.
Usable EtherCAT states
ecatInit, ecatBoot, ecatPreOP, ecatSafeOP, ecatOP
Examples
N/A
See also